-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Packaging and csv export #3
base: main
Are you sure you want to change the base?
Conversation
Add gitignore to the root of the repo: |
pyproject.toml
Outdated
name = "cloupe_package_nj9" | ||
version = "0.0.1" | ||
authors = [ | ||
{ name="Nithin", email="[email protected]" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ name="Martin Prete", email="[email protected]" },
{ name="Nithin Mathew Joseph", email="[email protected]" }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Wait shdn't the email be [email protected] and [email protected]?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aliases to full names will also work. But you're right, let's do short usernames only.
description = "Cloupe Parser" | ||
readme = "README.md" | ||
requires-python = ">=3.9.6" | ||
classifiers = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add classifiers:
- Development Status :: 4 - Beta
- Topic :: Scientific/Engineering :: Bio-Informatics
- License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Quick query were these stuff something I needed to know before hand. If so where can I find these info?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a) You're missing a comma in the list, between "License" and "Programming Language" classifiers.
b) The list of cannonical classifiers are avaiable at https://pypi.org/classifiers/ this is more a legacy thing and not very important as it has fallen out of use, still a nice thing to do properly.
|
||
# Final csv addition | ||
with open(barcode_clusters, 'w') as barcode_clusters_file: | ||
barcode_clusters_file.write("Barcodes,{},{}\n".format(cloupe.celltracks[0]["Name"],cloupe.celltracks[1]["Name"])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code ONLY works if there are two celltracks.
What if there are none? What if there's only one? What if there are 99?
barcode_clusters_file.write( | ||
"\n".join( | ||
[ | ||
re.sub(r"[()' ]", "", str(pair)) # Remove parentheses, single quotes, and spaces |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also fixed to only support 2 celltracks.
Should be dynamic based on the number of items in cloupe.celltracks
.
re.sub(r"[()' ]", "", str(pair))
is very odd
|
||
collection = [] | ||
# writing the barcodes to the csv files | ||
with open(barcodes, 'w') as barcodes_file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could each one of the writes (barcodes, features, and annotations) be an individual function. If so, should they be inside Cloupe class?
Have a look at https://docs.python.org/3.9/library/csv.html for writing CSVs with quoting and all that fun.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had been trying various combination of csv writter with the data that we have. I was finding it difficult to dump out the csv properly even when i was using the quoting and quotechar features along with the delimiter. I was thinking if i cud stick without using csv module. Let me know ur thoughts.
Regarding moving the writes as methods. My query would be do i remove the main function entirely and the cloupe.py will remain a class?
Related to #2 |
…he root directory
I have formatted the tool to take in input file via the argparse module and at the same time generate output csv files containing Barcodes, Features and Annotations. The build was meant to be used like a n executable hence was made in this format. To execute the code : --> Python3 ./cloupe.py <input_file path>
Once the script is executed it will generate .csv files in the current working directory.